package jedis.dao.impl;
import jedis.dao.ProvinceDao;
import jedis.domain.province;
import jedis.util.JdbcUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class ProvinceDaoImpl implements ProvinceDao {
    JdbcTemplate template=new JdbcTemplate(JdbcUtils.getDataSource());
    @Override
    public List<province> FindAll() {

        String sql="select * from province";
        List<province> query = template.query(sql, new BeanPropertyRowMapper<>(province.class));
        return query;
    }
}
